{js:artTemplate}
<script type='text/javascript' src='{webroot:public/javascript/orderFormClass.js}'></script>
<script type='text/javascript'>
//创建订单表单实例
orderFormInstance = new orderFormClass();

//DOM加载完毕
$(function(){
    // 隐藏底部导航
    hideNav();
    //商家信息
    orderFormInstance.seller = {echo:JSON::encode($this->sellerData)};

    //商品价格
    orderFormInstance.goodsSum = "{$this->final_sum}";

    //收货地址数据
    orderFormInstance.addressInit();

    //免运费
    orderFormInstance.freeFreight = {echo:JSON::encode($this->freeFreight)};

	//虚拟商品更新
	orderFormInstance.goodsType("{$this->goodsType}");
});
</script>

<div id="pageInfo" data-title="填写和提交订单信息"></div>
<section class="member_main cart_2">
    <div class="height15"></div>
    <div class="container info">
        <form action='{url:/simple/cart3}' class="form" method='post' name='order_form' onsubmit='return orderFormInstance.isSubmit()'>

            <input type='hidden' name='direct_gid' value='{$this->gid}' />
            <input type='hidden' name='direct_type' value='{$this->type}' />
            <input type='hidden' name='direct_num' value='{$this->num}' />

            <div class="cart_box m_10">
                <div class="cont">
                    <!--地址管理 开始-->
                    <div class="cart_sect cart_2_address" id="addressBox">
                        <div class="info_head cart_sect_header">收货人信息</div>

                        <!--收货表单信息 开始-->
                        <div id='address_often' class="prompt_4 m_10">
                            <ul class="addr_list block-row">
                                {foreach:items=$this->addressList}
                                <li id="addressItem{$item['id']}">
                                    <label>
                                        <input name="radio_address" type="radio" value="{$item['id']}"
                                        onclick="orderFormInstance.getDelivery({$item['province']});"/>
                                        <div class="address_info">
                                            <strong>{$item['accept_name']}</strong>
                                            <p>{$item['province_val']} {$item['city_val']} {$item['area_val']} {$item['address']}</p>
                                        </div>
                                    </label>
                                    <div class="col">
                                        <a href="javascript:orderFormInstance.addressEdit({$item['id']});">修改</a>
                                        <a href="javascript:orderFormInstance.addressDel({$item['id']});">删除</a>
                                    </div>
                                </li>
                                {/foreach}
                                <li>
                                    <div class="btn btn_all btn_pink" onclick="orderFormInstance.addressAdd();">添加新地址</div>
                                </li>
                            </ul>
                            <!--收货地址项模板-->
                            <script type='text/html' id='addressLiTemplate'>
                                <li id="addressItem<%=item['id']%>">
                                    <label>
                                        <input name="radio_address" type="radio" value="<%=item['id']%>"
                                        onclick="orderFormInstance.getDelivery(<%=item['province']%>);" />
                                        <div class="address_info">
                                        <strong><%=item['accept_name']%></strong>
                                        <p><%=item['province_val']%> <%=item['city_val']%> <%=item['area_val']%> <%=item['address']%></p>
                                        </div>
                                    </label>
                                    <div class="col">
                                        <a href="javascript:orderFormInstance.addressEdit(<%=item['id']%>);">修改</a>
                                        <a href="javascript:orderFormInstance.addressDel(<%=item['id']%>);">删除</a>
                                    </div>
                                </li>
                            </script>
                        </div>
                    </div>
                    <!--地址管理 结束-->
                </div>
                <!--配送方式 开始-->
                <div class="cart_sect cart_2_delivery" id="deliveryBox">
                    <div class="info_head cart_sect_header">配送方式</div>

                    <!--配送修改 开始-->
                    <div class="delivery">
                        <ul>
                           {foreach:items = Api::run('getDeliveryList')}
                            <li>
                                <label>
                                    <input type="radio" name="delivery_id" value="{$item['id']}" paytype="{$item['type']}"
                                    onclick='orderFormInstance.deliverySelected({$item['id']});' />
                                    <div class="info">
                                        <strong id="deliveryShow{$item['id']}"></strong>
                                        <p>{$item['name']} {$item['description']}</p>
                                        {if:$item['type'] == 2}
                                        <span class="ziti_btn" onclick="orderFormInstance.selectTakeself({$item['id']})">选择自提点</span>
                                        <span id="takeself{$item['id']}"></span>
                                        {/if}
                                    </div>
                                </label>
                            </li>
                            {/foreach}
                        </ul>
                        <!--配送信息-->
                        <script type='text/html' id='deliveryTemplate'>
                            <strong>运费：￥<%=item['price']%></strong>
                            <%if(item['protect_price'] > 0){%>
                            <strong>保价：￥<%=item['protect_price']%></strong>
                            <%}%>
                        </script>

                        <!--物流自提点-->
                        <script type='text/html' id='takeselfTemplate'>
                            [<%=item['address']%> <%=item['name']%> <%=item['phone']%> <%=item['mobile']%>]
                        </script>
                        <ul class="block-row">
                            <li>
                                指定送货时间：
                                <label>
                                    <input type='radio' class="option-input radio" name='accept_time' checked="checked" value='任意' />
                                    <span>任意</span>
                                </label>
                                <label>
                                    <input type='radio' class="option-input radio" name='accept_time' value='周一到周五' />
                                    <span>周一到周五</span>
                                </label>
                                <label>
                                    <input type='radio' class="option-input radio" name='accept_time' value='周末' />
                                    <span>周末</span>
                                </label>
                            </li>
                        </ul>
                    </div>

                </div>
                <!--配送方式 结束-->
                <!--支付方式 开始-->
                <div class="cart_sect cart_2_pay" id="paymentBox">
                    <div class="info_head cart_sect_header">支付方式</div>
                    <div class="pay_box">
                        {foreach:items = Api::run('getPaymentList')}
                        {set:$paymentPrice = CountSum::getGoodsPaymentPrice($item['id'],$this->sum);}
                        <label>
                            <input name="payment" alt="{$paymentPrice}" type="radio" value="{$item['id']}"
                            onclick='orderFormInstance.paymentSelected({$item['id']});' title="{$item['name']}" />
                            <div class="info">{$item['name']} {$item['note']} {if:$paymentPrice}支付手续费：￥{$paymentPrice}{/if}</div>
                        </label>
                        {/foreach}
                    </div>
                </div>
                <!--支付方式 结束-->
                <!--订单留言 开始-->
                <div class="cart_sect cart_2_message">
                    <div class="info_head cart_sect_header">订单附言</div>
                    <div class="message_box"><input class="form-control" placeholder="请输入订单附言" type="text" name='message' /></div>
                </div>
                <!--订单留言 结束-->
                <!--购买清单 开始-->
                <div class="cart_sect cart_2_pro">
                    <div class="info_head cart_sect_header">购买的商品</div>
                    <ol {if:empty($this->promotion)}style="display:none"{/if}>
                        <span>本单享受的活动：</span>
                        {foreach:items = $this->promotion}
                        <li>{$item['plan']}，{$item['info']}</li>
                        {/foreach}
                    </ol>
                    <!-- 商品展示 开始-->
                    <ul>
                    {foreach:items = $this->goodsList}
                        <li>
                            <img src="{url:/pic/thumb/img/$item[img]/w/80/h/80}">
                            <div class="info">
                                <h4>{$item['name']}</h4>
                                {if:isset($item['spec_array'])}
                                {set:$spec_array=goods_class::show_spec($item['spec_array']);}
                                <div class="tip">
                                    {foreach:items=$spec_array item=$specValue key=$specName}
                                        <!-- {$specName}： -->
                                        <span>{$specValue}</span>
                                    {/foreach}
                                </div>
                                {/if}
                                <div class="count">
                                    <h10 class="disnone" id="deliveryFeeBox_{$item['goods_id']}_{$item['product_id']}_{$item['count']}"></h10>
                                    <strong>数量：</strong><i>{$item['count']}</i>
                                    <strong>小计：</strong><em>￥{$item['sum']}</em>
                                </div>
                            </div>
                        </li>
                    {/foreach}
                    </ul>
                    <!-- 商品展示 结束-->
                </div>
                <!--购买清单 结束-->
                <!--金额结算-->
                <div class="cart_sect cart_2_count">
                    <div class="info_head cart_sect_header">结算信息</div>
                    <div class="count">
                        {if:$this->final_sum != $this->sum}优惠后总金额{else:}商品总金额{/if}：<strong>{$this->final_sum}</strong><br>
                        - 优惠券：<strong name='ticket_value'>0</strong><br>
                        + 税金：<strong id='tax_fee'>0</strong><br>
                        + 运费总计：<strong id='delivery_fee_show'>0</strong><br>
                        + 保价：<strong id='protect_price_value'>0</strong><br>
                        + 支付手续费：<strong id='payment_value'>0</strong>
                        {if:$this->spend_point > 0} + 消耗积分：<strong>{$this->spend_point}</strong>{/if}
                    </div>
                    <div class="btn_box">
                        <div class="btn btn_all btn_pink" onclick="orderFormInstance.ticketShow();">使用优惠券</div>
                    </div>
                </div>
                <!-- 发票信息 -->
                <div class="cart_sect cart_2_tax">
                    <div class="info_head cart_sect_header">发票信息</div>
                    <div class="tax_box">
                        <p>是否需要发票？(税金:￥{$this->goodsTax})</p>
                        <label>
                            <input class="radio" class="option-input radio" style="position:relative" onchange="orderFormInstance.doAccount();$('#tax_title').toggle();" name="taxes" type="checkbox" value="{$this->goodsTax}" />
                            <span></span>
                        </label>
                    </div>
                    <label id="tax_title" class="tax_title input_li" style='display:none'>
						<select name="invoice_id" class="input_select mbb">
							<option value="">请选择发票...</option>
							{foreach:items=Api::run("getInvoiceListByUserId")}
							<option value="{$item['id']}">{$item['company_name']}</option>
							{/foreach}
						</select>
						<input class="btn" onclick="orderFormInstance.editInvoice();" value="添加发票信息" />
                    </label>
                </div>
				<input id="goSubmit" type="submit" class="none">
                <!-- 发票信息 结束 -->
                <footer id="viewport_bottom">
                    <div class="cart_footer">
                        <label class="buy" for="goSubmit">
                            确认
                        </label>
                        <div class="trade_count">
                            <span>实付:</span>
                            <em id='final_sum'>{$this->final_sum}元</em>
                        </div>
                    </div>
                </footer>
            </div>
        </form>
    </div>
</section>
